package com.tencent.wxcloudrun.controller;

import javax.annotation.Resource;

import com.tencent.wxcloudrun.vo.request.acti.*;
import com.tencent.wxcloudrun.vo.response.acti.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.tencent.wxcloudrun.config.ApiResponse;
import com.tencent.wxcloudrun.manager.ActiQueryManager;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j;

/**
 * @Author ZhaoZiYin
 * @Date 2025/2/20
 * @Description 活动查询控制器
 */
@Api(tags = "活动查询控制器")
@Slf4j
@RestController
@Validated
@RequestMapping("/api/actiQuery")
public class ActiQueryController {

    @Resource
    private ActiQueryManager actiQueryManager;

    @ApiOperation("查询活动列表")
    @PostMapping(value = "/list")
    public ApiResponse<ActiListResVo> list(@RequestBody @Valid ActiListReqVo reqVo) {
        return ApiResponse.ok(actiQueryManager.list(reqVo));
    }

    @ApiOperation("查询活动")
    @PostMapping(value = "/query")
    public ApiResponse<ActiQueryResVo> query(@RequestBody @Valid ActiQueryReqVo reqVo) {
        return ApiResponse.ok(actiQueryManager.query(reqVo));
    }

    @ApiOperation("查询活动结果")
    @PostMapping(value = "/queryResult")
    public ApiResponse<ActiQueryResultResVo> queryResult(@RequestBody @Valid ActiQueryResultReqVo reqVo) {
        return ApiResponse.ok(actiQueryManager.queryResult(reqVo));
    }

    @ApiOperation("查询活动发货信息")
    @PostMapping(value = "/queryPost")
    public ApiResponse<ActiQueryPostResVo> queryPost(@RequestBody @Valid ActiQueryPostReqVo reqVo) {
        return ApiResponse.ok(actiQueryManager.queryPost(reqVo));
    }

    @ApiOperation("查询活动用户返图")
    @PostMapping(value = "/queryUserImg")
    public ApiResponse<ActiQueryUserImgResVo> queryUserImg(@RequestBody @Valid ActiQueryUserImgReqVo reqVo) {
        return ApiResponse.ok(actiQueryManager.queryUserImg(reqVo));
    }

}
